package com.tengju.data.domain.model.report;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Getter
public class SmallTeamAchievement {

    private List<Achievement> achievementList;


    public SmallTeamAchievement addAchievement(Integer teamRatioType,BigDecimal smallTeamMoneyOut,BigDecimal smallTeamCancelMoneyOut,BigDecimal smallTeamCancelBeforeMoneyOut,BigDecimal selfMoneyOut) {
        Achievement achievement = new Achievement();
        achievement.setSelfConsumeIndex(selfMoneyOut);
        achievement.setConsumeIndex(smallTeamMoneyOut);
        achievement.setTeamRatioType(teamRatioType);
        achievement.setSmallTeamCancelMoneyOut(smallTeamCancelMoneyOut);
        achievement.setSmallTeamCancelBeforeMoneyOut(smallTeamCancelBeforeMoneyOut);
        if (achievementList == null) {
            achievementList = new ArrayList<>();
        }
        achievementList.add(achievement);
        return this;
    }


    @Setter(value = AccessLevel.PRIVATE)
    @Getter
    static class Achievement {
        /**
         * 商品类型
         */
        private Integer teamRatioType;

        /**
         * 小团队有效出货额（消费指数）
         */
        private BigDecimal consumeIndex;

        /**
         * 小团队取消出货额
         */
        private BigDecimal smallTeamCancelMoneyOut;

        /**
         * 小团队取消本月之前订单的出货额
         */
        private BigDecimal smallTeamCancelBeforeMoneyOut;

        /**
         * 自身有效出货额(个人消费指数)
         */
        private BigDecimal selfConsumeIndex;
    }

}
